package com.zx.mes.rabbitmq.hyl.object;

import com.zx.mes.rabbitmq.hyl.model.Person;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * hello 消费者
 * @author hyl
 * @date 2018-3-16
 */
@Component
@RabbitListener(queues = "object")
public class ObjectConsumer {

    private static final Logger logger = LoggerFactory.getLogger(ObjectConsumer.class);

    @RabbitHandler
    public void consumer(Person person){
        logger.info("receiver:name:{}",person.getName());
    }
}
